package gamecenter.gc.service.Imp;

import gamecenter.gc.bean.Game;
import gamecenter.gc.mapper.Game_Mapper;
import gamecenter.gc.service.Game_Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Game_Service_Imp implements Game_Service {
    @Resource
    private Game_Mapper game_mapper;

    @Override
    public List<Game> get_all_On_Game() {
        return game_mapper.get_all_On_Game();
    }

    @Override
    public List<Game> get_all_On_Game_From_Developer(String developer_name) {
        return game_mapper.get_all_On_Game_From_Developer(developer_name);
    }

    @Override
    public Game get_Cer_Game_From_Name(String game_name) {
        return game_mapper.get_Cer_Game_From_Name(game_name);
    }

    @Override
    public void add_Game(Game game) {
        game_mapper.add_Game(game);
    }

    @Override
    public void on_Cer_Game(String game_name) {
        game_mapper.on_Cer_Game(game_name);
    }

    @Override
    public boolean check_Game_On(String game_name) {
        Game game = game_mapper.get_Cer_Game_From_Name(game_name);
        return game.isOn();
    }

    @Override
    public List<Game> get_All_Game_from_Cer_Category(String category) {
        return game_mapper.get_All_Game_from_Cer_Category(category);
    }

    @Override
    public List<Game> get_all_Game_From_Developer(String developer_name) {
        return game_mapper.get_all_Game_From_Developer(developer_name);
    }


}
